from sympy import symbols, integrate, solve

# 定义符号变量
x = symbols('x')
A = symbols('A')

# 定义 f(x) 的表达式
f_x = x ** 2 - A

# 计算定积分并建立方程
eq = integrate(f_x, (x, 0, 1)) - A

# 解方程
solution = solve(eq, A)
f_x_final = f_x.subs(A, solution[0])

print("∫₀¹f(x)dx 的值:", solution)
print("f(x) 的表达式:", f_x_final)